Skip to content

[codex] Inline contracts request-context service shapes#3204

Merged
juliusmarminge merged 2 commits into
mainfrom
codex/effect-service-contracts-context
Jun 20, 2026
Merged

[codex] Inline contracts request-context service shapes#3204
juliusmarminge merged 2 commits into
mainfrom
codex/effect-service-contracts-context

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • inline the EnvironmentAuthenticatedPrincipal request-context interface in its Context.Service tag
  • inline the RelayClientPrincipal and RelayEnvironmentPrincipal request-context interfaces in their tags
  • remove the redundant standalone *Shape exports and normalize Effect namespace import ordering

Why

These request-context tags exposed duplicate standalone shape names even though Effect already exposes each service interface through Service["Service"]. Keeping the interface on the tag makes the tag the single source of truth and aligns these contracts with the repository's target Effect service convention.

Schema-only exception

packages/contracts is intentionally schema-only. These are context tags consumed by HTTP middleware, not runtime service implementations, so this PR intentionally does not add make functions or Layer exports. Runtime construction remains in the consuming applications.

This is a type-organization change only; HTTP error schemas, middleware contracts, wire fields, and runtime behavior are unchanged.

Validation

  • vp run --filter @t3tools/contracts test (11 files, 161 tests)
  • vp check (passes with 20 pre-existing warnings outside this diff)
  • vp run typecheck

Note

Inline service shape types in RelayClientPrincipal and RelayEnvironmentPrincipal

Removes the RelayClientPrincipalShape and RelayEnvironmentPrincipalShape interfaces from relay.ts and replaces their generic type parameters with inline object type literals directly on the service classes. No behavioral changes — this is a structural refactor of the type definitions.

Macroscope summarized a7903cf.


Note

Low Risk
Contracts-only type organization with identical principal fields and no runtime or wire-format changes.

Overview
Aligns relay HTTP request-context tags with the repo’s Effect service convention by making each Context.Service tag the single source of truth for its principal shape.

In relay.ts, removes the exported RelayClientPrincipalShape and RelayEnvironmentPrincipalShape interfaces and passes those field sets directly as the second generic argument to RelayClientPrincipal and RelayEnvironmentPrincipal. Field names and types are unchanged; only where the type is declared moves.

Also reorders imports so Schema is grouped with the other effect/* namespace imports (no behavioral impact).

Reviewed by Cursor Bugbot for commit a7903cf. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ff5aed24-c7c7-4e91-bf2b-51f277d2b728

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/effect-service-contracts-context

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jun 20, 2026
@juliusmarminge
juliusmarminge marked this pull request as ready for review June 20, 2026 02:06
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea ae3bd597809dfd7771d0898f735d172973d4c1c8
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
App version: 0.1.0
Git commit: d0f282101e54a1f4777321725f9e7e659acd39f5
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
App version: 0.1.0
Git commit: 318593fd88314a388ad3503e67042249907a3418
Update Details Update Permalink
DetailsBranch: pr-3204
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
Git commit: 1ab46c6a28dd6f2e2aa8c45b58550be993a7f82b
Update Permalink
DetailsBranch: pr-3204
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
Git commit: 1ab46c6a28dd6f2e2aa8c45b58550be993a7f82b
Update QR

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

A prior Macroscope approval was dismissed. Re-evaluating a7903cf

Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the codex/effect-service-contracts-context branch from c295514 to f71798d Compare June 20, 2026 02:27
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 02:27

Dismissing prior approval to re-evaluate f71798d

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Jun 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 02:32

Dismissing prior approval to re-evaluate a7903cf

@juliusmarminge
juliusmarminge enabled auto-merge (squash) June 20, 2026 02:32
@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jun 20, 2026
@juliusmarminge
juliusmarminge merged commit ab0baaa into main Jun 20, 2026
15 checks passed
@juliusmarminge
juliusmarminge deleted the codex/effect-service-contracts-context branch June 20, 2026 02:34
aaditagrawal added a commit to aaditagrawal/t3code that referenced this pull request Jun 24, 2026
…ct-service-foundations

[codex] Inline contracts request-context service shapes (pingdotgg#3204)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant